<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>众筹管理后台</title>
<link rel="stylesheet" href="<%=basePath%>admin/css/bootstrap.min.css" />
<link rel="stylesheet" href="<%=basePath%>admin/css/dashboard.css" />
</head>
<body>

	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target="#navbar" aria-expanded="false"
					aria-controls="navbar">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">众筹管理平台</a>
			</div>
			<div id="navbar" class="navbar-collapse collapse">

				<ul class="nav navbar-nav navbar-right">
          	<li><a href="<%=basePath %>/pages/index.action">首页</a></li>
          	<li><a href="#">欢迎 ${admin.name }</a></li>
            <li><a href="#" title="修改个人资料和密码的页面">设置</a></li>
            <li><a href="#" title="退出登录">退出</a></li>
          </ul>
			</div>
		</div>
	</nav>

	<div class="container-fluid">
		<div class="row">
			<div class="col-sm-3 col-md-2 sidebar">
				<ul class="nav nav-sidebar">
					<li><a href="<%=basePath%>pages/index.action">首页</a></li>
				</ul>
				<ul class="nav nav-sidebar">
					<li><a href="<%=basePath %>Projects/mav.action">所有项目*</a></li>
            <li><a href="<%=basePath %>Projects/projecReview.action">项目审核</a></li>
            <li><a href="<%=basePath %>Projects/trackingList.action">项目跟踪</a></li>
            <li><a href="<%=basePath %>Projects/productComments.action">项目评论</a></li>
            <li><a href="<%=basePath %>Projects/classity.action">项目分类*</a></li>
					<li class="active" ><a href="<%=basePath %>Projects/recommend.action">项目推荐</a></li>
				</ul>
				 <ul class="nav nav-sidebar">
            <li><a href="<%=basePath %>pages/backReg.action">注册管理员</a></li>
            <!-- <li><a href="">用户资金</a></li>
            <li><a href="">用户日志</a></li> -->
            <!-- <li><a href="">实名审核</a></li> -->
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="<%=basePath %>news/list.action">新闻管理</a></li>
            <li><a href="<%=basePath %>Projects/questionall.action">问题管理</a></li>
            <li><a href="<%=basePath %>adminLogin/adminList.action">管理用户</a></li>
            <!-- <li><a href="">管理日志</a></li> -->
				</ul>
			</div>
			<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
				<h1 class="page-header">所有众筹项目</h1>

				<div class="panel panel-default">
					<div class="panel-body">
						<form class="form-inline"
							action="<%=basePath%>Projects/recommend.action">
							<!-- <div class="form-group">
								<input type="text" class="form-control" name="name"
									id="exampleInputName2" placeholder="项目名称">
							</div>
							<div class="form-group">
								<input type="text" class="form-control" name="usId"
									id="exampleInputName2" placeholder="项目发起人">
							</div> -->
							<div class="form-group">
								<!-- <input type="text" class="form-control" name="recommend"
									id="exampleInputName2" placeholder="是否推荐"> -->
									<select class=form-control name="recommend">
									<option value="">是否推荐</option>
									<option value="0">不推荐</option>
									<option value="1">推荐</option>
									</select>
							</div>
							<!-- <div class="form-group">
								<select class=form-control name="type">
									<option value="">项目状态</option>
									<option value="0">待审核</option>
									<option value="1">待上架</option>
									<option value="2">众筹中</option>
									<option value="3">众筹成功</option>
									<option value="4">众筹失败</option>
									<option value="5">审核未通过</option>

								</select>
							</div> -->
							<%-- <div class="form-group">
								<select class=form-control name="pstId">
									<option value="">项目类型</option>
									<c:forEach items="${list}" var="projectStype">
										<option value="${projectStype.name}">${projectStype.name }</option>
									</c:forEach>

								</select>
							</div> --%>
							&nbsp;&nbsp;
							<button type="submit" class="btn btn-default btn-primary">查询</button>
						</form>
					</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title">所有项目列表</div>
					</div>
					<div class="panel-body">

						<div class="table-responsive ">
							<table class="table table-striped table-bordered">
								<thead>
									<tr>
										<th>序号</th>
										<th>项目类型</th>
										<th>项目名称</th>
										<th>项目进度</th>
										<th>项目状态</th>
										<th>开始日期</th>
										<th>结束日期</th>
										<th>已筹金额</th>
										<th>发起人</th>
										<th>是否推荐</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${findAllSplit}" var="projects">
										<tr>
											<td>${projects.id }</td>
											<td>${projects.projectStype.name }</td>
											<td>${projects.name }</td>
											<td>${projects.getMoney/projects.money*100 }%</td>
											<td><c:if test="${projects.type eq 0}">待审核</c:if> <c:if
													test="${projects.type eq 1}">待上架</c:if> <c:if
													test="${projects.type eq 2}">众筹中</c:if> <c:if
													test="${projects.type eq 3}">众筹成功</c:if> <c:if
													test="${projects.type eq 4}">众筹失败</c:if> <c:if
													test="${projects.type eq 5}">审核未通过</c:if></td>
											<td><fmt:formatDate value="${projects.startTime }"
													type="both" /></td>
											<td><fmt:formatDate value="${projects.endTime }"
													type="both" /></td>
											<td>${projects.getMoney }</td>
											<td>${projects.user.name }</td>
											<td><c:if test="${projects.recommend eq 0}">不推荐</c:if> <c:if
													test="${projects.recommend eq 1}">推荐</c:if></td>
											<td>
												<!-- <a href="product/product-info1.html">详情</a> --> <a
												href="<%=basePath %>Projects/detailRecommend.action?ps_id=${projects.id }">详情</a>
												<!--<a href="#" title="查看项目详情"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a>-->
												<!--&nbsp;&nbsp;
                  	<a href="#" title="编辑项目信息"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>-->
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>

						</div>
						<div class="pager-info">
							<div>共有 ${findAllCount}条记录，第 ${start1}/${allPage} 页</div>
							<div>
								<ul class="pagination">
									<c:if test="${start1 > 1}">
										<li><a
											href="<%=basePath %>Projects/recommend.action?currentPage=${start1-1}&name=${name }&usId=${usId }&type=${type }&pstId=${pstId }&recommend=${recommend}&lineSize=${lineSize}">上一页</a>
										</li>
									</c:if>
									<c:if test="${start1 <= 1}">
										<li class="paginate_button previous disabled }"><a
											href="#">上一页</a></li>
									</c:if>

									<c:forEach begin="1" end="${allPage}" step="1" var="pageNum">
										<c:if test="${start1 eq pageNum }">
											<li class="paginate_button active"><a
												href="<%=basePath %>Projects/recommend.action?currentPage=${pageNum}&name=${name }&usId=${usId }&type=${type }&pstId=${pstId }&recommend=${recommend}">${pageNum}</a></li>
										</c:if>
										<c:if test="${start1 ne pageNum }">
											<li class="paginate_button"><a
												href="<%=basePath %>Projects/recommend.action?currentPage=${pageNum}&name=${name }&usId=${usId }&type=${type }&pstId=${pstId }&recommend=${recommend}">${pageNum}</a></li>
										</c:if>
									</c:forEach>
									<c:if test="${start1 < allPage}">
										<li><a
											href="<%=basePath %>Projects/recommend.action?currentPage=${start1+1}&name=${name }&usId=${usId }&type=${type }&pstId=${pstId }&recommend=${recommend}&lineSize=${lineSize}">下一页</a>
										</li>
									</c:if>
									<c:if test="${start1 >= allPage}">
										<li class="paginate_button previous disabled }"><a
											href="#">下一页</a></li>
									</c:if>
								</ul>
							</div>
						</div>

						<!--  <nav aria-label="Page navigation" class="text-right">
				  <ul class="pagination">
				    <li class="disabled">
				      <a href="#" aria-label="Previous">
				        <span aria-hidden="true">&laquo;</span>
				      </a>
				    </li>
				    <li class="active"><a href="#">1</a></li>
				    <li><a href="#">2</a></li>
				    <li><a href="#">3</a></li>
				    <li><a href="#">4</a></li>
				    <li><a href="#">5</a></li>
				    <li>
				      <a href="#" aria-label="Next">
				        <span aria-hidden="true">&raquo;</span>
				      </a>
				    </li>
				  </ul>
				</nav>   	 -->
					</div>


				</div>

			</div>
		</div>
	</div>

	<script type="text/javascript" src="js/jquery1.12.4.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/countUp.js"></script>
	<script>
		/* function setValue(){		
			var name = document.getElementById("exampleInputName2").value;
			document.getElementById("exampleInputName2").value=name;
		} */
		$(document).ready(function() {

		});
	</script>
</body>
</html>
